package cn.edu.scau.cmi.dengzejun.chapter11;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class PoliceListen implements ActionListener{
	JTextField textInput;
	JTextArea textShow;
	public void setJTextField(JTextField text) {
		this.textInput = text;
		return;
	}
	
	public void setJTextArea(JTextArea area) {
		this.textShow = area;
		return;
	}
	
	public void actionPerformed(ActionEvent e) {
		String str = this.textInput.getText();
		this.textShow.append("the length of "+str+" is "+str.length()+'\n');
		return;
	}
}
